package com.lds.config.center.common.model.item.request;

import com.lds.management.center.common.model.db.request.BaseUpdateRequest;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 更新 - 请求
 *
 * @author lidongsheng
 * @since 2025-06-30
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ItemBaseUpdateRequest extends BaseUpdateRequest implements Serializable {
    /**
     * 属性ID
     */
    @NotNull(message = "id不能为空")
    private Long id;


    /**
     * 属性名
     */
    private String name;
    /**
     * 属性值
     */
    private String value;
    /**
     * 配置项类型，0: String，1: Number，2: Boolean，3: JSON
     */
    private Integer valueType;
    /**
     * 描述
     */
    private String desc;
    /**
     * 行号
     */
    private Integer lineNum;
    /**
     * 配置文件ID
     */
    private Long namespaceId;

    public void setName(String name) {
        this.name = StringUtils.trimToNull(name);
    }

    public void setValue(String value) {
        this.value = StringUtils.trimToNull(value);
    }

    public void setDesc(String desc) {
        this.desc = StringUtils.trimToNull(desc);
    }


}
